<?php 
if($this->session->userdata('logged_in')){
?>

	<h1>Hi <?php echo $cartpoolData['user']->name; ?></h1>
	<a href="/logout/">logout</a>
	
<?php 
}else{
?>
	<fieldset id="login">
		<h1>Login</h1>
		<h2><a href="#login">I already have an account</a></h2>
		<form id="loginForm" action="/login/signin/" method="post">
			<div> 
				<label for="email">Email address</label> 
				<input class="tooltip_launch" name="email" class="" id="email" maxlength="35" rel="Email" />
				<span></span>
				<p class="tooltip_content">The email address you registered with.</p> 
			</div> 
			<div>
				<label for="password">Password</label> 
				<input class="passw_passw tooltip_launch" type="password" name="password" id="password" maxlength="35" /> 
				<input class="passw_text" type="text" value="Password"  id="password_text" maxlength="35" /> 
				<p class="tooltip_content">Please type your password.</p> 
			</div> 
			
			<?php if(isset($loginError)){ echo $loginError; } ?>
			<input class="button" type="submit" value="Login" />
		</form>
		
	</fieldset>
	<img src="/assets/images/spacer.gif" />
	<fieldset id="register">
		<h1>Register</h1>
		<h2><a href="#register">I don't have an account</a></h2>
		<form id="registerForm" action="/login/register/" method="post">
			<div> 
				<label for="reg_groupname">Groupname</label>
				<input class="tooltip_launch" name="reg_groupname" id="reg_groupname" maxlength="35" rel="Groupname" /> 
				<span></span>
				<p class="tooltip_content">The name of the group you want to join or create.</p>
			</div>
			
			<div>
				<label for="reg_name">Name</label> 
				<input class="tooltip_launch" name="reg_name" id="reg_name" maxlength="35" rel="Name" /> 
				<span></span>
				<p class="tooltip_content">just your name or nickname</p>
			</div> 
			
			<div> 
				<label for="reg_email">Email address</label> 
				<input class="tooltip_launch" name="reg_email" id="reg_email" maxlength="35" rel="Email" /> 
				<span></span>
				<p class="tooltip_content">a valid email adress, we wont pass it to others, prompise!</p>
			</div> 
			
			<div> 
				<label for="reg_password">Password</label> 
				<input class="passw_passw tooltip_launch" type="password" name="reg_password" id="reg_password" maxlength="35" /> 
				<input class="passw_text" type="text" value="Password" maxlength="35" /> 
				<p class="tooltip_content">come up with a password, any password will do.</p>
			</div> 
			
			<div> 
				<label for="reg_password2">Repeat password</label> 
				<input class="passw_passw tooltip_launch" type="password" name="reg_password2" id="reg_password2" maxlength="35" /> 
				<input class="passw_text" type="text" value="Retype password" maxlength="35" />
				<p class="tooltip_content">now type it again.. just to be sure</p>
			</div> 
			
			<?php if(isset($registerError)){ echo $registerError; } ?>
			
			<input class="button" type="submit" value="Register" />
		</form>
		
	</fieldset>

<?php 
}
?>